/**
 * @author yuyangyang
 * @time 2015/3/16
 */
var JoinModel = require('../models/join');
module.exports = {
    addJoin: function (params, callback) {
        new JoinModel(params).save(callback);
    },
    queryItem: function (params, callback) {
        JoinModel.findOne(params, callback);
    },
    delete: function (params, callback) {
        JoinModel.remove(params, callback);
    },
    queryBySport: function (condition, params, callback) {
        JoinModel.find(params)
            .where('joiner')
            .ne(condition)
            .populate('joiner')
            .exec(callback);
    }
}